package com.hfh.jdbc;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;

/**
 * @Author hfh
 * @Date 2022 09 20 11 19
 **/
public class IOUtils {
    private IOUtils(){}

    public static void transfer(InputStream is,String target) throws IOException {
        FileOutputStream os = new FileOutputStream(target);
        byte[] arr = new byte[1024];
        int len;
        while ((len = is.read(arr))!=-1){
            os.write(arr,0,len);
        }
        is.close();
    }
}
